package exception_homework;

/**
 * 异常的抛出
 */
public class ThrowDemo {
    public static void main(String[] args) {
        System.out.println("程序开始了..");
        Student zs = new Student();
        try {
            zs.setAge(1000);
            System.out.println(zs.getAge());
        }catch (RuntimeException e){
            System.out.println("年龄不合法");
        }
    }
}
